package com.crm.common.ka.core.feign.admin.entity;

/**
 * 员工范围枚举
 * @author litianyi
 */
public enum StaffRangeEnum {

    //全公司
    ALL(0),
    //仅本部门
    DEPT(1),
    //本部门及下属
    DEPT_AND_CHILD_DEPT(2),
    //仅本人
    SELF(3),
    //下属部门
    CHILD_DEPT(4),
    //渠道销售情况
    CHANNEL_SALES(5);

    private Integer staffRange;

    StaffRangeEnum(Integer staffRange) {
        this.staffRange = staffRange;
    }

    public Integer getStaffRange() {
        return staffRange;
    }

    public void setStaffRange(Integer staffRange) {
        this.staffRange = staffRange;
    }

    public static StaffRangeEnum parse(Integer staffRange) {
        for (StaffRangeEnum range : values()) {
            if (range.getStaffRange().equals(staffRange)) {
                return range;
            }
        }
        return null;
    }
}
